/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upn.sigemfi.seg.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Programador
 */
@Entity
@Table(name = "SEG_PERSONA_NATURAL")
@PrimaryKeyJoinColumn(name = "FID_SEG_PERSONA", referencedColumnName = "ID_PERSONA")
@DiscriminatorValue(value = "PEN")
public class PersonaNatural
        extends Persona
        implements Serializable {

    @Column(name = "NOMBRE_PERSONA", length = 50)
    private String nombrePersona;
    @Column(name = "APE_MATERNO_PERSONA", length = 50)
    private String apeMaternoPersona;
    @Column(name = "APE_PATERNO_PERSONA", length = 50)
    private String apePaternoPersona;
    @Column(name = "DNI_PERSONA", length = 8)
    private String dniPersona;
    @Enumerated(EnumType.ORDINAL)
    @Column(name = "SEX_PERSONA", length = 1)
    private Sexo sexPersona;
    @Column(name = "FECNAC_PERSONA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecnacPersona;
    @Enumerated(EnumType.ORDINAL)
    @Column(name = "ESTADO_CIVIL", length = 1)
    private EstadoCivil estadoCivil;

    public PersonaNatural() {
    }

    public PersonaNatural(Long idPersona, String nombrePersona, String apeMaternoPersona, String apePaternoPersona, String dniPersona, Sexo sexPersona, Date fecnacPersona, EstadoCivil estadoCivil) {
        super(idPersona);
        this.nombrePersona = nombrePersona;
        this.apeMaternoPersona = apeMaternoPersona;
        this.apePaternoPersona = apePaternoPersona;
        this.dniPersona = dniPersona;
        this.sexPersona = sexPersona;
        this.fecnacPersona = fecnacPersona;
        this.estadoCivil = estadoCivil;
    }

    public String getApeMaternoPersona() {
        return apeMaternoPersona;
    }

    public void setApeMaternoPersona(String apeMaternoPersona) {
        this.apeMaternoPersona = apeMaternoPersona;
    }

    public String getApePaternoPersona() {
        return apePaternoPersona;
    }

    public void setApePaternoPersona(String apePaternoPersona) {
        this.apePaternoPersona = apePaternoPersona;
    }

    public String getDniPersona() {
        return dniPersona;
    }

    public void setDniPersona(String dniPersona) {
        this.dniPersona = dniPersona;
    }

    public Date getFecnacPersona() {
        return fecnacPersona;
    }

    public void setFecnacPersona(Date fecnacPersona) {
        this.fecnacPersona = fecnacPersona;
    }

    public String getNombrePersona() {
        return nombrePersona;
    }

    public void setNombrePersona(String nombrePersona) {
        this.nombrePersona = nombrePersona;
    }

    public EstadoCivil getEstadoCivil() {
        return estadoCivil;
    }

    public void setEstadoCivil(EstadoCivil estadoCivil) {
        this.estadoCivil = estadoCivil;
    }

    public Sexo getSexPersona() {
        return sexPersona;
    }

    public void setSexPersona(Sexo sexPersona) {
        this.sexPersona = sexPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPersona != null ? idPersona.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Persona)) {
            return false;
        }
        Persona other = (Persona) object;
        if ((this.idPersona == null && other.idPersona != null) || (this.idPersona != null && !this.idPersona.equals(other.idPersona))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.seg.be.Persona[idPersona=" + idPersona + "]";
    }
}
